package casa.depesos.app.com.http.req;


import java.util.Map;

import casa.depesos.app.com.http.HttpReq;
import casa.depesos.app.com.http.ReqCallback;
import casa.depesos.app.com.http.bean.PayBean;
import casa.depesos.app.com.http.data.Fee;
import casa.depesos.app.com.http.parser.PayParser;

public class PayReq implements HttpReq<PayBean> {

    long amount;
    Fee fee;

    public PayReq(long amount, Fee fee) {
        this.amount = amount;
        this.fee = fee;
    }

    @Override
    public void req(ReqCallback<PayBean> callback) {//  trial
        req("/app/financial/simulateCreditApproval", new PayParser(), callback);
    }

    @Override
    public Map getBody() {
        Map map = HttpReq.super.getBody();
        map.put("cval", amount);
        map.put("fprop", fee.rate);
        map.put("rrpayrate", fee.backRate);
        map.put("fkind", fee.type);
        map.put("substage", fee.phase);
        map.put("pnum", fee.id);
        return map;
    }
}
